clear;
load tamc_radial_profile.dat;
N1=1;
N2=10000;
N3=6;
e = size(tamc_radial_profile,1)/N2 - 1;
%d = e -1;
d = fix(3*e/4);
%c= e - 2;
c = fix(e/2);
b = fix(e/4);
a = 1;
r(1:N2,1:N3) = 0;
vel(1:N2,1:N3 + 1) = 0;
rho(1:N2,1:N3 + 1)= 0;
pressure(1:N2,1:N3 + 1) = 0;
vel2(1:N2,1:N3 + 1) = 0;
rho2(1:N2,1:N3 + 1)= 0;
pressure2(1:N2,1:N3 + 1) = 0;
for j=1:N2,
    r(j,1) = tamc_radial_profile(j,1);
    r(j,2) = tamc_radial_profile(a*N2 + j,1);
    r(j,3) = tamc_radial_profile(b*N2 + j,1);
    r(j,4) = tamc_radial_profile(c*N2 + j,1);
    r(j,5) = tamc_radial_profile(d*N2 + j,1);
    r(j,6) = tamc_radial_profile(e*N2 + j,1);
    vel(j,1)=tamc_radial_profile(j,1);
    vel(j,2)=tamc_radial_profile(j,2);
    vel(j,3)=tamc_radial_profile(a*N2 + j,2);
    vel(j,4)=tamc_radial_profile(b*N2 + j,2);
    vel(j,5)=tamc_radial_profile(c*N2 + j,2);
    vel(j,6)=tamc_radial_profile(d*N2 + j,2);
    vel(j,7)=tamc_radial_profile(e*N2 + j,2);
    rho(j,1)=tamc_radial_profile(j,1);
    rho(j,2)=tamc_radial_profile(j,3);
    rho(j,3)=tamc_radial_profile(a*N2 + j,3);
    rho(j,4)=tamc_radial_profile(b*N2 + j,3);
    rho(j,5)=tamc_radial_profile(c*N2 + j,3);
    rho(j,6)=tamc_radial_profile(d*N2 + j,3);
    rho(j,7)=tamc_radial_profile(e*N2 + j,3);
    pressure(j,1)=tamc_radial_profile(j,1);
    pressure(j,2)=tamc_radial_profile(j,4);
    pressure(j,3)=tamc_radial_profile(a*N2 + j,4);
    pressure(j,4)=tamc_radial_profile(b*N2 + j,4);
    pressure(j,5)=tamc_radial_profile(c*N2 + j,4);
    pressure(j,6)=tamc_radial_profile(d*N2 + j,4);
    pressure(j,7)=tamc_radial_profile(e*N2 + j,4);     
    
    vel2(j,1)=tamc_radial_profile(j,1);
    vel2(j,2)=tamc_radial_profile(j,5);
    vel2(j,3)=tamc_radial_profile(a*N2 + j,5);
    vel2(j,4)=tamc_radial_profile(b*N2 + j,5);
    vel2(j,5)=tamc_radial_profile(c*N2 + j,5);
    vel2(j,6)=tamc_radial_profile(d*N2 + j,5);
    vel2(j,7)=tamc_radial_profile(e*N2 + j,5);
    rho2(j,1)=tamc_radial_profile(j,1);
    rho2(j,2)=tamc_radial_profile(j,6);
    rho2(j,3)=tamc_radial_profile(a*N2 + j,6);
    rho2(j,4)=tamc_radial_profile(b*N2 + j,6);
    rho2(j,5)=tamc_radial_profile(c*N2 + j,6);
    rho2(j,6)=tamc_radial_profile(d*N2 + j,6);
    rho2(j,7)=tamc_radial_profile(e*N2 + j,6);
    pressure2(j,1)=tamc_radial_profile(j,1);
    pressure2(j,2)=tamc_radial_profile(j,7);
    pressure2(j,3)=tamc_radial_profile(a*N2 + j,7);
    pressure2(j,4)=tamc_radial_profile(b*N2 + j,7);
    pressure2(j,5)=tamc_radial_profile(c*N2 + j,7);
    pressure2(j,6)=tamc_radial_profile(d*N2 + j,7);
    pressure2(j,7)=tamc_radial_profile(e*N2 + j,7);   

end;
figure(1);
plot(r(1:N2,6),vel(1:N2,7),'red',r(1:N2,6),vel2(1:N2,7),'blue');
title ('u(x)');
xlabel ('r cm');
ylabel ('U cm/s');
grid ;
figure(2);
plot(r(1:N2,6),rho(1:N2,7),'red',r(1:N2,6),rho2(1:N2,7),'blue');
title ('density');
xlabel ('r cm');
ylabel ('rho 10^-5 g/cm^3');
grid ;
figure(3);
plot(r(1:N2,6),pressure(1:N2,7),'red',r(1:N2,6),pressure2(1:N2,7),'blue');
title ('pressure');
xlabel ('r cm');
ylabel ('P din/cm^2');
grid ;
